<template>
	<a-spin :spinning="spinning" :delay="120">
		<div class="container">
			<div class="toolbar">
				<a-form ref="formRef" :model="list">
					<h3 style="margin: 10px 0; text-align: center"><b>{{ (contract?.project?.name || '') + ' ' + applyArgs.contract_name + '结算单' }}</b></h3>
					<a-table :columns="innerColumns" :scroll="tableScroll" row-key="id" children-column-name="children" :pagination="false" :data-source="list" :loading="loading">
						<template #headerCell="{ column }">
							<template v-if="column.title.includes('\n')">
								<span>
									{{ column.title.split('\n')[0] }}<br />{{ column.title.split('\n')[1] }}
								</span>
							</template>
							<template v-else-if="column.title === 'up_per'">
								<span v-if="contract.price_type === 2">
									浮动比率±(%)
								</span>
								<span v-else-if="contract.price_type === 3">
									浮动价格(±)
								</span>
							</template>
						</template>
						<template #bodyCell="{ column, index, record }">
							<template v-if="column.dataIndex === 'append_subprice'">
								<a-form-item :name="[index, 'material', 'append_subprice']" :rules="{ required: true, message: '请输入附加价' }">
									<a-input-number v-model:value="record.material.append_subprice" placeholder="请输入" :disabled="optDisabled" @change="changeSubjoinAmount" />
								</a-form-item>
							</template>
							<template v-else-if="column.dataIndex === 'use_position' && [1,2,3,5].includes(list[0]?.supplyOrder.ys_type)">
								<a-row :gutter="20">
									<a-col :span="24">
										<a-form-item :name="[index, 'use_position']" :rules="{ required: true, message: '请选择详细部位' }">
											<a-tree-select v-model:value="record.use_position" :dropdown-match-select-width="false" :show-search="true" placeholder="请选择详细部位" allow-clear tree-default-expand-all :tree-data="gonghaoTree" tree-node-filter-prop="label" style="width:100%" :disabled="optDisabled" @change="changeUsePosition(record)">
												<template #title="{ label }">{{ label }}</template>
											</a-tree-select>
										</a-form-item>
									</a-col>
								</a-row>
							</template>
							<template v-else-if="column.dataIndex === 'account_type_id'">
								<a-row :gutter="20">
									<a-col :span="24">
										<a-form-item :name="[index, 'material', 'account_type_id']" :rules="{ required: true, message: '核算分类' }">
											<a-select v-model:value="record.material.account_type_id" placeholder="请选择核算分类" :options="accountTypeOptions" option-filter-prop="label" :disabled="optDisabled"></a-select>
										</a-form-item>
									</a-col>
								</a-row>
							</template>
							<template v-else-if="column.dataIndex === 'expenditure_id'">
								<a-row :gutter="20">
									<a-col :span="24">
										<a-form-item :name="[index, 'material', 'expenditure_id']" :rules="{ required: true, message: '支出方向' }">
											<a-select v-model:value="record.material.expenditure_id" placeholder="请选择支出方向" :options="expenditureOptions" option-filter-prop="label" :disabled="optDisabled" allow-clear></a-select>
										</a-form-item>
									</a-col>
								</a-row>
							</template>
							<template v-else-if="column.dataIndex === 'brand'">
								<a-row :gutter="20">
									<a-col :span="24">
										<a-form-item :name="[index, 'material', 'brand']" :disabled="optDisabled">
											<a-input v-model:value="record.material.brand" placeholder="请输入品牌" :disabled="optDisabled" />
										</a-form-item>
									</a-col>
								</a-row>
							</template>
						</template>
						<template #summary>
							<a-table-summary-row style="background-color:#f0f0f0;font-size:12px;font-weight:bold;">
								<a-table-summary-cell :col-span="3" style="text-align: center">
									<a-typography-text type="danger">合计</a-typography-text>
								</a-table-summary-cell>
								<a-table-summary-cell v-if="list[0]?.supplyOrder.ys_type === 2" :col-span="3"></a-table-summary-cell>
								<!--								<a-table-summary-cell :col-span="10"></a-table-summary-cell>-->
								<a-table-summary-cell :col-span="7"></a-table-summary-cell>
								<a-table-summary-cell :col-span="1" style="text-align: center">{{ totalAmount.append_subprice }}</a-table-summary-cell>
								<a-table-summary-cell v-if="contract.price_type !== 1 && contract.price_type" :col-span="1" style="text-align: center">
									{{ contract.price_type ===3? totalAmount.up_per: '' }}
								</a-table-summary-cell>
								<a-table-summary-cell :col-span="1" style="text-align: center">{{ totalAmount.with_tax_subprice }}</a-table-summary-cell>
								<a-table-summary-cell :col-span="1" style="text-align: center">{{ totalAmount.with_tax_amount }}</a-table-summary-cell>
								<a-table-summary-cell :col-span="1" style="text-align: center">{{ totalAmount.without_tax_subprice }}</a-table-summary-cell>
								<a-table-summary-cell :col-span="1" style="text-align: center">{{ totalAmount.without_tax_amount }}</a-table-summary-cell>
								<a-table-summary-cell :col-span="1" style="text-align: center">{{ totalAmount.tax_amount }}</a-table-summary-cell>
								<a-table-summary-cell :col-span="2">
									<a-input-number v-model:value="totalAmount.amount" :min="0" addon-before="本次结算总额" placeholder="请输入金额" :disabled="optDisabled" />
								</a-table-summary-cell>
							</a-table-summary-row>
						</template>
					</a-table>
				</a-form>
				<div>
					<h3 style="margin: 10px 0;"><b>单据信息</b></h3>
					<a-form ref="formOther" :model="applyArgs">
						<a-descriptions v-if="optDisabled" bordered size="middle">
							<a-descriptions-item label="合同号">{{ applyArgs.contract_name }}</a-descriptions-item>
							<a-descriptions-item label="供应商" :span="2">{{ applyArgs.supplier_name }}</a-descriptions-item>
							<a-descriptions-item label="结算附件下载">
								<!--								<a-button :href="list[0]?.settlement.file_path[0]?.url" target="_blank">下载附件</a-button><br />-->
								<span style="color:#ccc">{{ list[0]?.settlement?.file_path[0]?.name }}</span>
							</a-descriptions-item>
							<a-descriptions-item label="合同附件" :span="2">
								<a :href="applyArgs.contract_file?.url" target="_blank">{{ applyArgs.contract_file?.name }}</a>
							</a-descriptions-item>
							<a-descriptions-item label="结算说明" :span="3">
								{{ applyArgs.memo }}
							</a-descriptions-item>
						</a-descriptions>
						<div v-else>
							<a-row :gutter="20">
								<a-col :span="12">
									<a-form-item label="合同号" name="contract_name">
										{{ applyArgs.contract_name }}
									</a-form-item>
								</a-col>
								<a-col :span="12">
									<a-form-item label="供应商" name="supplier_name">
										{{ applyArgs.supplier_name }}
									</a-form-item>
								</a-col>
							</a-row>
							<a-row>
								<a-col :span="12">
									<a-form-item label="上传附件" name="file_path" :rules="{ required: false, message: '请上传附件' }">
										<a-upload v-model:file-list="applyArgs.file_path" name="upload" :action="`${baseURL}/contract/upload`" :show-upload-list="true" :headers="{ Authorization: `Bearer ${proxy.$cookies.get('token')}` }" :before-upload="beforeUpload" @change="changeUpload">
											<a-button :disabled="optDisabled">
												<template v-if="uploading">
													<loading-outlined />上传中...
												</template>
												<template v-else>
													<import-outlined />上传附件
												</template>
											</a-button>
										</a-upload>
										<span style="color:#ccc">如需补充相关资料，请上传佐证资料，可上传格式 <span style="color:red">DOC,EXCEL,PDF</span>文件</span>
									</a-form-item>
								</a-col>
								<a-col :span="12">
									<a-form-item label="合同附件" name="contract_file">
										<a-button :href="applyArgs.contract_file?.url" target="_blank">下载附件</a-button><br />
										<span style="color:#ccc">{{ applyArgs.contract_file?.name }}</span>
									</a-form-item>
								</a-col>
							</a-row>
							<a-row>
								<a-col :span="24">
									<a-form-item label="结算说明" name="memo" :rules="{ required: false, message: '请输入备注' }">
										<a-input v-model:value="applyArgs.memo" placeholder="结算说明" :disabled="optDisabled" />
									</a-form-item>
								</a-col>
							</a-row>
						</div>
					</a-form>
				</div>
				<div class="mt-5 text-center">
					<template v-if="!optDisabled">
						<div>
							<div>
								<a-button type="primary" @click="handleSave('save')">保存台账</a-button>
								<a-button type="primary" style="margin-left: 1rem" @click="handleSave('apply')">生成结算申请单</a-button>
							</div>
						</div>
					</template>
					<template v-else>
						<a-button type="default" @click="back">返回</a-button>
					</template>
				</div>
			</div>
		</div>
	</a-spin>
</template>
<script setup>
import { useRoute, useRouter } from "vue-router";
import { computed, getCurrentInstance, onMounted, ref } from "vue";
import { postJson, post, treeToList } from "@/utils/index.js";
import dayjs from "dayjs";
import { Modal } from "ant-design-vue";
import { baseURL } from "../utils/request";
import { add } from "@/utils/operation.js";

const columns = [
	{
		title: "验收日期",
		dataIndex: "enter_time",
		sorter: false,
		width: 150,
		ellipsis: true,
		customRender: ({ text, record, index, column }) => {
			return dayjs(text).format("YYYY-MM-DD HH:mm:ss");
		}
	},
	{
		title: "材料名称",
		dataIndex: "material",
		sorter: false,
		width: 150,
		ellipsis: true,
		customRender: ({ text, record, index, column }) => {
			return text.name;
		}
	},
	{
		title: "规格型号",
		dataIndex: "material",
		sorter: false,
		width: 150,
		ellipsis: true,
		customRender: ({ text, record, index, column }) => {
			return text.model;
		}
	},
	{
		title: "计量单位",
		dataIndex: "unit",
		sorter: false,
		width: 150,
		ellipsis: true,
	},
	{
		title: "采购数量",
		dataIndex: "quantity",
		sorter: false,
		width: 150,
		ellipsis: true,
	},
	{
		title: "验收数量",
		dataIndex: "ys_quantity",
		sorter: false,
		width: 150,
		ellipsis: true,
	},
	{
		title: "发货单编号",
		dataIndex: "supplyOrder",
		sorter: false,
		width: 150,
		customRender: ({ text, record, index, column }) => {
			return text.code;
		}
	},
	{
		title: "验收单编号",
		dataIndex: "yanshou",
		sorter: false,
		width: 150,
		customRender: ({ text, record, index, column }) => {
			return text?.code;
		}
	},
	{
		title: "验收人",
		dataIndex: "yanshou",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text?.opr?.fullname;
		}
	},
	// {
	// 	title: "核算分类",
	// 	dataIndex: "account_type_id",
	// 	sorter: false,
	// 	width: 150,
	// 	align: "center",
	// },
	// {
	// 	title: "使用部位",
	// 	dataIndex: "use_position",
	// 	sorter: false,
	// 	width: 200,
	// 	align: "center",
	// 	customRender: ({ text, record, index, column }) => {
	// 		return '';
	// 	}
	// },
	{
		title: "是否泵送（长度）",
		dataIndex: "changdu",
		sorter: false,
		width: 200,
		align: "center",
	},
	{
		title: "申请塌落度（mm）",
		dataIndex: "luodu",
		sorter: false,
		width: 200,
		align: "center",
	},
	{
		title: "预计浇筑部位",
		dataIndex: "expected_location",
		sorter: false,
		width: 200,
		align: "center",
	},
	// {
	// 	title: "支出方向",
	// 	dataIndex: "expenditure_id",
	// 	sorter: false,
	// 	width: 150,
	// 	align: "center",
	// },
	{
		title: "备注",
		dataIndex: "memo",
		sorter: false,
		width: 150,
		align: "center",
	},
	{
		title: "附加价",
		dataIndex: "append_subprice",
		sorter: false,
		width: 150,
		align: "center",
	},
	{
		title: "up_per",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return contract.value.price_type === 2 ? text.up_per + '%' : text.up_per;
		}
	},
	{
		title: "综合含税单价\n(元)",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text.with_tax_subprice;
		}
	},
	{
		title: "含税总价\n(元)",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text.with_tax_amount;
		}
	},
	{
		title: "不含税单价\n(元)",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text.without_tax_subprice;
		}
	},
	{
		title: "不含税总价\n(元)",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text.without_tax_amount;
		}
	},
	{
		title: "税额\n(元)",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text.tax_amount;
		}
	},
	{
		title: "税率",
		dataIndex: "material",
		sorter: false,
		width: 150,
		align: "center",
		customRender: ({ text, record, index, column }) => {
			return text.tax + '%';
		}
	},
	{
		title: "品牌",
		dataIndex: "brand",
		sorter: false,
		width: 150,
		align: "center",
	},
];
const innerColumns = computed(() => {
	let columnList = columns;
	if (contract.value.price_type === 1 || !contract.value.price_type) {
		columnList = columnList.filter(item => item.title !== "up_per");
	}
	if (list.value[0]?.supplyOrder.ys_type !== 2) {
		columnList = columnList.filter(item => !["expected_location", 'changdu', 'luodu'].includes(item.dataIndex));
	}
	return columnList;
});
const route = useRoute();
const supply_order_ids = route.query.supply_order_ids.split(",");
const contract_id = route.query.contract_id;
const optDisabled = ref(route.query.optType === 'select');
const contract = ref({});
const loading = ref(false);
const list = ref([]);
const accountTypeOptions = ref([]);
const expenditureOptions = ref([]);
const gonghaoTree = ref([]);
const totalAmount = ref({
	append_subprice: 0,
	with_tax_amount: 0,
	with_tax_subprice: 0,
	without_tax_amount: 0,
	without_tax_subprice: 0,
	tax_amount: 0,
	amount: null,
});
const uploading = ref(false);
const spinning = ref(false);
const formRef = ref();
const formOther = ref();
const { proxy } = getCurrentInstance();
const router = useRouter();
const applyArgs = ref({
	file_path: [],
	contract_name: '',
	supplier_name: '',
	memo: null,
	contract_file: null,
})
post("dictionary", { root_code: "ACCOUNT_TYPE" }).then(data => {
	accountTypeOptions.value = data || [];
});
post("dictionary", { root_code: "EXPENDITURE" }).then(data => {
	expenditureOptions.value = data;
});
onMounted(async () => {
	const result = await post(`supplyOrder/materials`, {
		supply_order_ids: JSON.stringify(supply_order_ids),
		contract_ids: JSON.stringify([contract_id]),
	})
	const yanshouList = await post(`yanshoulog/all`, {
		supply_order_ids: JSON.stringify(supply_order_ids),
		contract_ids: JSON.stringify([contract_id]),
	})
	const yanshouList2SupplyOrderId = yanshouList.reduce((target, item) => {
		target[item.supplyorder_id] = item;
		return target;
	}, {})
	const contractList = await post(`contract/all`, {
		contract_ids: contract_id,
	});
	contract.value = contractList[0];
	applyArgs.value.contract_name = contract.value.name;
	applyArgs.value.supplier_name = contract.value.supplier.company_name;
	applyArgs.value.contract_file = JSON.parse(contract.value.file_path)[0];
	const contractMaterial2Id = contract.value.materials.reduce((target, item) => {
		target[item.id] = item;
		return target;
	}, {})

	if ([1, 2, 3, 5].includes(result[0]?.supplyOrder.ys_type)) {
		const usePositions = await post("department/getTrees", { type: 4, parent_id: contract.value.project_id });
		gonghaoTree.value = usePositions;
	}
	const settlementList = (await post(`settlement/material`, {
		supply_order_ids: JSON.stringify(supply_order_ids),
		contract_ids: JSON.stringify([contract_id]),
	}));
	const settlementList2SupplyMaterialId = settlementList.reduce((target, item) => {
		target[`${item.supply_order_id}_${item.material_id}`] = item;
		return target;
	}, {})
	// 筛选已结算数据
	const dates = [];
	for (const item of result) {
		const settlement = settlementList2SupplyMaterialId[`${item.supply_order_id}_${item.material.id}`];
		if (settlement && settlement.settlement_id) {
			continue;
		} else if (settlement) {
			item.gonghao_id = settlement.gonghao_id;
			item.position = settlement.position;
		}
		// 商砼
		if ([1, 2, 3, 5].includes(item?.supplyOrder.ys_type)) {
			if (item.position || item.gonghao_id) {
				const gonghaoList = treeToList(JSON.parse(JSON.stringify(gonghaoTree.value)), []);
				const use_position = gonghaoList.filter((i) => {
					return i.id === (item.position || item.gonghao_id)
				})[0]
				item.use_position = use_position.value;
			}
		}
		item.yanshou = yanshouList2SupplyOrderId[item.supply_order_id];
		const material = item.material;
		material.append_subprice = null;
		if (settlement) {
			delete settlement.id;
			Object.assign(material, settlement, settlement.record);
			totalAmount.value.with_tax_amount += settlement.with_tax_amount * 100;
			totalAmount.value.with_tax_subprice += settlement.with_tax_subprice * 100;
			totalAmount.value.without_tax_amount += settlement.without_tax_amount * 100;
			totalAmount.value.without_tax_subprice += settlement.without_tax_subprice * 100;
			totalAmount.value.tax_amount += settlement.tax_amount * 100;
			if (contract.value.price_type === 2) {
				totalAmount.value.up_per += settlement.up_per * 100;
			}
			item.unit = settlement.unit;
			dates.push(item);
			continue;
		}
		const contractMaterial = contractMaterial2Id[material.id];
		if (contractMaterial) {
			const { with_tax_subprice, without_tax_subprice, without_tax_subprice_base, tax, up_per } = contractMaterial.ContractMaterial;
			const with_tax_amount = Math.round(with_tax_subprice * item.ys_quantity * 100) / 100;
			const without_tax_amount = Math.round(without_tax_subprice * item.ys_quantity * 100) / 100;
			const tax_amount = Math.round(with_tax_amount * 100 - without_tax_amount * 100) / 100
			totalAmount.value.with_tax_amount += with_tax_amount * 100;
			totalAmount.value.with_tax_subprice += with_tax_subprice * 100;
			totalAmount.value.without_tax_amount += without_tax_amount * 100;
			totalAmount.value.without_tax_subprice += without_tax_subprice * 100;
			totalAmount.value.tax_amount += tax_amount * 100;
			if (contract.value.price_type === 2) {
				totalAmount.value.up_per += up_per * 100;
			}
			Object.assign(material, {
				with_tax_amount, with_tax_subprice, without_tax_amount, without_tax_subprice, without_tax_subprice_base, tax_amount, tax, up_per,
			})
		}
		// 混凝土都是立方米单位
		if (list.value[0]?.supplyOrder.ys_type !== 2) {
			item.unit = item.unit || 'm³';
		}
		item.material.append_subprice = item.material?.append_subprice || 0;
		dates.push(item);
	}
	totalAmount.value.with_tax_amount = Math.round(totalAmount.value.with_tax_amount) / 100;
	totalAmount.value.with_tax_subprice = Math.round(totalAmount.value.with_tax_subprice) / 100;
	totalAmount.value.without_tax_amount = Math.round(totalAmount.value.without_tax_amount) / 100;
	totalAmount.value.without_tax_subprice = Math.round(totalAmount.value.without_tax_subprice) / 100;
	totalAmount.value.tax_amount = Math.round(totalAmount.value.tax_amount) / 100;
	totalAmount.value.amount = add([totalAmount.value.append_subprice, totalAmount.value.with_tax_amount], 2);
	if (contract.value.price_type === 2) {
		totalAmount.value.up_per = Math.round(totalAmount.value.up_per) / 100;
	}
	list.value = dates;
	changeSubjoinAmount()
})
const tableScroll = computed(() => ({ x: document.documentElement.clientWidth - 650 }));
// 改变附加价格
function changeSubjoinAmount() {
	totalAmount.value.append_subprice = 0;
	// totalAmount.value.amount = null;
	list.value.map((item) => {
		totalAmount.value.append_subprice += parseFloat(item.material.append_subprice || 0);
	})
	totalAmount.value.amount = add([totalAmount.value.append_subprice, totalAmount.value.with_tax_amount], 2);
}
// 改变部位
function changeUsePosition(record) {
	if (!record.use_position) {
		record.gonghao_id = null;
		record.position = null;
		return;
	}
	const gonghao_id = record.use_position.split('-')[1];
	let position = record.use_position.split('-').slice(-1)[0];
	if (gonghao_id === position) {
		position = null;
	}
	record.gonghao_id = gonghao_id;
	record.position = position;
}
// 提交
async function handleSave(save_type) {
	if (!list.value.length) {
		return proxy.$message.error('物料列表不能为空');
	}
	// if (save_type === 'apply' && (!applyArgs.value.file_path.length || !applyArgs.value.file_path[0].url)) {
	// 	await formOther.value.validate();
	// 	return proxy.$message.error('请上传附件');
	// }
	formRef.value
		.validate()
		.then(() => {
			proxy.$message.destroy();
			if (!totalAmount.value.amount) {
				return proxy.$message.error('请输入结算总金额');
			}
			const keys = [
				'account_type_id', 'expenditure_id', 'append_subprice',
			];
			const data = {
				save_type,
				file_path: JSON.stringify(applyArgs.value.file_path),
				project_id: contract.value.project_id,
				contract_id: contract.value.id,
				ys_type: list.value[0]?.supplyOrder.ys_type,
				supplier_id: contract.value.supplier_id,
				memo: applyArgs.value.memo,
				...totalAmount.value,
				materials: list.value.map(item => {
					const material = {};
					for (const key of keys) {
						material[key] = item.material[key];
					}
					return {
						...material,
						material_id: item.material.id,
						supply_order_id: item.supply_order_id,
						ys_code: item.yanshou.code,
						gonghao_id: item.gonghao_id,
						position: item.position,
						record: {
							brand: item.material.brand,
							expected_location: item.expected_location,
							luodu: item.luodu,
							changdu: item.changdu,
						},
						ys_opr_id: item.yanshou.opr_id,
						contract_id: contract.value.id,
					}
				}),
			}
			if (save_type === 'save') {
				spinning.value = true;
				postJson("settlement/save", data).then(() => {
					proxy.$message.success("保存成功", 1);
					spinning.value = false;
				});
			} else {
				Modal.confirm({
					title: "操作确认?",
					content: "您确定申请结算吗，请确认",
					onOk() {
						spinning.value = true;
						postJson("settlement/save", data)
							.then(() => {
								spinning.value = false;
								proxy.$message.success("申请成功", 1);
								router.push('/settlement/apply');
							})
							.catch(err => {
								proxy.$message.error(err);
								spinning.value = false;
							});
					}
				});
			}
		})
		.catch(err => {
			spinning.value = false;
			proxy.$message.error(err.errorFields?.[0].errors[0] || err.message || err);
		})
}
//上传前校验
const beforeUpload = file => {
	uploading.value = true;
	if (!['application/pdf', 'application/vnd.ms-excel', 'application/msword', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'].includes(file.type)) {
		proxy.$message.error("只能上传DOC,EXCEL,PDF文件");
		uploading.value = false;
		return false;
	}
	const isLt10M = file.size / 1024 / 1024 < 10;
	if (!isLt10M) {
		proxy.$message.error("只能上传10MB以下文件");
		uploading.value = false;
		return false;
	}
};
// 上传并提交文件
const changeUpload = ({ file }) => {
	if (file.status === "done") {
		applyArgs.value.file_path = [
			{
				name: file.name,
				url: file.response.data.url
			}
		];
		applyArgs.value.file_path = applyArgs.value.file_path.filter((item) => item.url);
		uploading.value = false;
		proxy.$message.success("上传成功");
	}
	if (!file.status) {
		applyArgs.value.file_path = applyArgs.value.file_path.filter((item) => item.url);
	}
};
// 返回
function back() {
	router.push('/settlement');
}
</script>
<style scoped lang="scss">
.container {
  background: #fff;
  padding: 12px;
}
:deep(.ant-table-cell) .ant-form-item {
  margin-bottom: 0;
}
:deep(.ant-descriptions-title) {
  text-align: center;
}
</style>
